/*
 * DailyQuotationTitleProvider.java
 * business
 *
 * Created by ChenTao on 2017/6/5.
 *
 * Copyright (c) 2017年 yidiandao. All rights reserved.
 */

package com.yidiandao.business.ui.widget.recyclerview.provider;

import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.yidiandao.business.R;

import me.drakeet.multitype.ItemViewProvider;

/**
 * 每日行情 标题 -Provider
 * <p>
 * Created by ChenTao(chentao7v@gmail.com) on 2017-06-05 10:20
 */
public class DailyQuotationTitleProvider extends ItemViewProvider<String, DailyQuotationTitleProvider.ViewHolder> {

    @NonNull
    @Override
    protected ViewHolder onCreateViewHolder(@NonNull LayoutInflater inflater, @NonNull ViewGroup parent) {
        return new ViewHolder(inflater.inflate(R.layout.item_daily_quotation_title, parent, false));
    }

    @Override
    protected void onBindViewHolder(@NonNull ViewHolder holder, @NonNull String title) {
        holder.tvTitle.setText(title);
    }

    static class ViewHolder extends RecyclerView.ViewHolder {

        private TextView tvTitle;

        public ViewHolder(View itemView) {
            super(itemView);
            tvTitle = (TextView) itemView.findViewById(R.id.tv_title);
        }
    }
}
